package cn.keepme.common.consts;

import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;

import cn.keepme.common.utils.PropUtils;
/**
 * 常量
 */
public class PublicParams {
	
	public static final SimpleDateFormat[] dayFormatter = {
		new SimpleDateFormat("yyyy年MM月dd日"),//0
		new SimpleDateFormat("yyyy-MM-dd"),//1
		new SimpleDateFormat("yyyy/MM/dd"),//2
		new SimpleDateFormat("yyyy年MM月dd日-HH点mm分ss秒"),//3
		new SimpleDateFormat("yyyy/MM/dd-HH:mm:ss"),//4
		new SimpleDateFormat("yyyy-MM-dd HH:mm:ss") ,//5
		new SimpleDateFormat("yyyyMMddHHmmss"),//6
		new SimpleDateFormat("yyyyMMdd"),//7
		new SimpleDateFormat("yyyyMM"),//8
		new SimpleDateFormat("yyyy年MM月")};//9
	
	public static String CONTEXT_PATH="";	// “/sp”
	public static String REAL_PATH="";  	// “D:\apache-tomcat\webapps\sp”
	
	/*********************常用参数*************************/
	//  存放允许访问的网关IP地址列表
	public static Vector<String> ALLOWIPS;
	//	接口URL分类
	public static Map<String,String> URL_MAP=new HashMap<String, String>();
	//	接口参数分类
	public static Map<String,String> PARAM_MAP=new HashMap<String, String>();
	//	接口短信号码
	public static Map<String,String> PORT_MAP=new HashMap<String, String>();
	//	接口类型
	public static String TYPE = PropUtils.getConfigInfo("type");
	
	static{
		String[] tmp = TYPE.split(",");
		for(int i=0; i<tmp.length; i++){
//			System.out.println(tmp[i]);
			URL_MAP.put(tmp[i], PropUtils.getConfigInfo("url_"+tmp[i]));
			PARAM_MAP.put(tmp[i], PropUtils.getConfigInfo("url_param_"+tmp[i]));
			PORT_MAP.put(tmp[i], PropUtils.getConfigInfo("url_port_"+tmp[i]));
		}
	}
}
